package 笔试;

public class Demo extends Base {
    private String name = "tom";
    public Demo() {
        printName();
    }
    public void printName() {
        System.out.println("Son print name: "+ name);
    }

    public static void main(String[] args) {
        new Demo();
    }
}
class Base {
    private  String name = "base";
    public Base(){
        printName();
    }
    public void printName() {
        System.out.println("Base print name: " + name);
    }
}
